<script setup lang="ts">
//声明属性
import {ref} from "vue";
import {fundById} from '@/api/platform/enterprise'
//声明事件
const emits = defineEmits(["close", "refresh"])
const props = defineProps({
  "visible": {
    type: Boolean,
    default: false
  }
})
//表单数据
const money = ref()
const tableData = ref([])

async function fundXx(params) {
  let data = {
    id:params
  }
  let res = await fundById(data)
  if (res.code == 200) {
    tableData.value = res.data.detailList
    money.value=res.data.money
  }
}

//暴露
defineExpose({fundXx})

//关闭窗口
function cls() {
  //抛出自定义事件
  emits("close");
}
</script>

<template>
  <el-dialog :model-value="visible" :close-on-click-modal="false" title="企业资金信息" width="532" @close="cls">
    <div style="width: 484px;height: 60px">
      <div style="width:360px;height:40px;margin: auto">
        <span>当前企业余额:&nbsp;&nbsp;</span>
        <el-input
          v-model="money"
          style="width: 240px"
          disabled
        />
      </div>
    </div>
    <!--表单-->
    <el-table :data="tableData" style="width: 100%" border stripe>
      <el-table-column prop="createTime" label="账户变动时间" width="100" header-align="center" align="center"/>
      <el-table-column prop="reason" label="账户变动原因" width="100" header-align="center" align="center"/>
      <el-table-column prop="avaliableMoney" label="可用资金账户" width="100" header-align="center" align="center"/>
      <el-table-column prop="freezeMoney" label="冻结资金账户" width="100" header-align="center" align="center"/>
      <el-table-column prop="type" label="变动类型"  width="100" header-align="center" align="center">
        <template v-slot="o">
          <span v-if="o.row.type==1">系统生成</span>
          <span v-if="o.row.type==2">暂定</span>
        </template>
      </el-table-column>
    </el-table>
  </el-dialog>
</template>

<style scoped lang="scss">

</style>
